package org.soc.timesheet.server.domain.service;

import java.util.List;

import org.soc.timesheet.domain.UsersLogged;
import org.soc.timesheet.domain.repository.UsersLoggedRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class UsersLoggedServiceImpl implements UsersLoggedService {
	@Autowired
	UsersLoggedRepository usersLoggedRepository;

	public long countAllUsersLoggeds() {
        return UsersLogged.countUsersLoggeds();
    }

	public void deleteUsersLogged(UsersLogged usersLogged) {
        usersLogged.remove();
    }

	public UsersLogged findUsersLogged(String id) {
        return UsersLogged.findUsersLogged(id);
    }

	public List<UsersLogged> findAllUsersLoggeds() {
        return UsersLogged.findAllUsersLoggeds();
    }

	public List<UsersLogged> findUsersLoggedEntries(int firstResult, int maxResults) {
        return UsersLogged.findUsersLoggedEntries(firstResult, maxResults);
    }

	public void saveUsersLogged(UsersLogged usersLogged) {
        usersLoggedRepository.save(usersLogged);
    }

	public UsersLogged updateUsersLogged(UsersLogged usersLogged) {
        return usersLogged.merge();
    }
}
